import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Java030 {
    public static void main(String[] args) {
        ArrayList<Integer> arr = new ArrayList<>();
        Collections.addAll(arr,1,2,3,5,6,7,8,9);
         insert(arr,new Scanner(System.in).nextInt());
         System.out.println(arr);
    }
    public static void insert(ArrayList<Integer> arr, int num){
        for(int i = arr.size()-1;i>0;i--){
            if(arr.get(i)<=num){
                arr.add(i+1,num);
                break;
            }
        }
    }
}
